home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 866 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.5 KB  |  40 lines

  1. Path: engnews1.Eng.Sun.COM!taumet!clamage
  2. From: clamage@taumet.eng.sun.com (Steve Clamage)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: Quick questions
  5. Date: 26 Mar 1996 18:56:35 GMT
  6. Organization: Carolian Systems, Toronto ON
  7. Approved: clamage@eng.sun.com (comp.std.c++)
  8. Message-ID: <315837ce.67891262@sqarc.sq.com>
  9. References: <4j5b26$1e7a@mule1.mindspring.com> <4j7a64$l9i@engnews1.Eng.Sun.COM>
  10. NNTP-Posting-Host: taumet.eng.sun.com
  11. X-Mailer: Forte Agent .99d/32.182
  12. Content-Length: 676
  13. X-Lines: 18
  14.  
  15. clamage@Eng.sun.com (Steve Clamage) wrote:
  16.  
  17. >>2) From a previous post on this group, it looks like the standard will
  18. >>allow one to define conversion operators for pre-existing, source code
  19. >>untouchable data types.  Yes? No? What will this look like? I have the
  20. >>May copy of the WP, and don't see any mention of this.
  21. >
  22. >I'm not sure I understand what you are asking. If you mean can you define
  23. >a conversion operator from a user-defined class to a predefined type
  24. >like int or double, then yes, that has long been part of C++.
  25.  
  26. I believe he was referring to something like
  27.  
  28. class myclass{};
  29. operator int(const myclass &arg);
  30.  
  31. Just like the global equality operators, etc.
  32.  
  33.  
  34.  
  35. [ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
  36. [ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
  37. [ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
  38. [ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
  39. [ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]
  40.